Page({
  data: {
    repairList: [],
  },
  onShow() {
    this.getRepairList()
  },
  // 获取报修列表
  getRepairList() {
    wx.http.get('/repair').then((res) => {
      if (res.code !== 10000) return wx.utils.toast()
      this.setData({ repairList: res.data.rows })
    })
  },
  goDetail(ev) {
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + ev.mark.id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})
